/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package weka.attributeSelection.semiAS.semiClusterAS;


/**
 *
 * @author Administrator
 */
public class FeatEvalM implements Score {

    private FeatCenterEval m_centerEval;
    private boolean m_isWeighted;
    private double m_LabledWeight;
    private double m_UnlabledWeight;
    private int[] m_indicator;
    private double[][] m_distance;
    private double[] m_featClassScore;

    public FeatEvalM(int[] indicator, final double[][] distance, double[] featClassScore, boolean b, double l, double u) {
        m_indicator = indicator;
        m_distance = distance;
        m_featClassScore = featClassScore;
        m_isWeighted = b;
        m_LabledWeight = l;
        m_UnlabledWeight = u;
        m_centerEval = new FeatCenterEval(m_indicator, m_distance);


    }

    public double getScore(int i) {
        double labelScore = 0.0;
        double unlabelScore = 0.0;

        if (m_UnlabledWeight != 0) {
            unlabelScore = m_centerEval.getScore(i);
        }

        if (m_isWeighted) {
            if (m_LabledWeight != 0) {
                labelScore = m_featClassScore[i];
            }
            return m_UnlabledWeight * unlabelScore + m_LabledWeight * labelScore;
        } else {
            return labelScore;
        }
    }

}
